function cache_get($id, $key, $apc=false) {
    if (isset($GLOBALS['CACHE']["$key:$id"])) {
		$cache = $GLOBALS['CACHE']["$key:$id"];
		$hit = 1;
	} elseif ($apc && (($cache = apc_fetch("$key:$id")) !== false) {
		$hit = 1;
	} else {
		if ($apc) { apc_store("$key:$id", $cache); }
	}
	if ($hit) { 
		$GLOBALS['CACHE']["$key:$id"] = $cache;
		return $hit ? $cache : null;
	}
}